package com.example.store2.Controller;

import com.example.store2.Service.OccupationService;
import com.example.store2.pojo.Occupation;
import com.example.store2.pojo.Result;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/occupation")
public class OccupationController {
    @Autowired
    OccupationService occupationService;
    @GetMapping
    public Result getoccname(){
        List<Occupation> occupations=occupationService.getoccname();
        return Result.success(occupations);
    }

}
